<div class="modal hide fade" id="myModal2">
<div class="modal-header">
    <button class="close" data-dismiss="modal">x</button>
    <h3>REGISTRO DE PROFESORES</h3>
</div>
	<?php echo $this->Form->create('Profesore', array('action' => 'guardaexcel', 'enctype' => 'multipart/form-data')); ?>
		<div class="formSep">
			<div class="modal-body">
				<div class="span4">
						Selexionar Excel:   
					<span class="input file">
                            <span class="file-text"></span>
                            <input type="file" name="data[Excel][excel]" id="special-input-1" value="" class="file withClearFunctions" multiple="" />
                    </span>
				</div>
			</div>
		</div>
		<div class="form-actions">
			<button class="btn btn-success" type="submit">
				Guardar Excel
			</button>
		</div>
        </form>
		
</div>
<div class="row-fluid">
    <div class="span12">
        <h3 class="heading">Profesores <input type="button" value="Busqueda" onclick='$("#formulario").toggle(400);' ></h3> 
        <div id="formulario" style="display: none;">
        <h4>BUSCAR PROFESOR</h4>    
        <?php echo $this->Form->create('Profesore'); ?> 
        <div class="formSep">
            <div class="row-fluid">
                <div class="span4">
                    <label>Nombre </label>
                    <?php echo $this->Form->text('Profesore.nombre');?>
                </div>
                <div class="span4">
                    <label>Apellido Paterno </label>
                    <?php echo $this->Form->text('Profesore.ap_paterno');?>
                </div>
                <div class="span4">
                    <label>Apellido Materno </label>
                    <?php echo $this->Form->text('Profesore.ap_materno');?>
                </div>
            </div>
            
        </div>
    
        <div class="form-actions">
            <?php
            echo $this->Js->submit('Buscar', array('url' => '/Profesores/ajaxlistado', 'update' => '#listado'));
            echo $this->Form->end();
            ?>      
        </div> 
        </div>
        <div id="listado">
        <table class="table table-striped table-bordered dTableR" id="dt_a">
            <thead>
                <tr>                                          
                    <th>Apellido Paterno</th>
                    <th>Apellido Materno</th>
                    <th>Nombre</th>
                    <th>Observacion</th>                    
                    <th>Acciones</th>     
                </tr>
            </thead>
            <tbody>
                <?php foreach ($profesores as $prof): ?>
                    <?php $idProfe = $prof['Profesore']['id']; ?>
                    <tr>                                                 
                        <td><?php echo $prof['Profesore']['ap_paterno']; ?></td>
                        <td><?php echo $prof['Profesore']['ap_materno']; ?></td>
                        <td><?php echo $prof['Profesore']['nombre']; ?></td> 
                        <td><?php echo $prof['Profesore']['observacion']; ?></td>
                        <td>
                            <?php echo $this->Html->image("iconos/edit.png", array("title" => "edita al Profesor",'url' => array('action'=>'editar', $idProfe)));?> 
                            <?php echo $this->Html->image("iconos/elim.png", array("title" => "elimina al Profesor",'url' => array('action'=>'eliminar', $idProfe)));?>
                            <?php //echo $this->Html->link('EDITAR',array('action'=>'editar',$prof['Profesore']['id']));?>
                            <?php //echo $this->Html->link('ELIMINAR',array('action'=>'eliminar',$prof['Profesore']['id']),null,('Desea aliminar a este Profesor.....!!!!!?')); ?> 
                        </td>
                    </tr>
                    <?php
                endforeach;
                ?>
            </tbody>
        </table>
        <a data-toggle="modal" data-backdrop="static" href="#myModal2">
    <?php 
    echo $this->Form->button('Registrar Excel',array('class' => 'btn btn-success'));
    ?>  
    </a>
    <?php 
    echo $this->Html->link('Descargar Plantilla',$this->Html->webroot("../app/webroot/files/PlantillaProfesores.xlsx"),array('class' => 'btn btn-success'));
    ?>
        </div>
                        
    </div>   
</div>
<?php echo $this->
	element('sidebar/profesores'); ?>
	<?php echo $this->
		element('jstablas'); ?>
<!-- fin sidebar -->
<?php echo $this->element('jstablas'); ?>
<?php echo $this->Js->writeBuffer(); ?>
 